// 用户模块 这个模块中有自己的reducer action state
export const initState = {
    info: {
        age: 18,
        name: 'Tom'
    }
}

const userReducer = (state=initState, action) => {
    switch (action.type) {
        case 'changeName':
            // 新增订单内容
            let obj = {...state.info};
            obj.name = action.name
            return {
                ...state,
                info: obj
            }
    
        default:
            return state
    }
}

export default userReducer